//
//  YWWeekTopView.m
//  YWCalendar
//
//  Created by YR on 2017/5/25.
//  Copyright © 2017年 YR. All rights reserved.
//

#import "YWWeekTopView.h"

@implementation YWWeekTopView

- (instancetype)init {
    self = [super init];
    if (self) {
        [self viewAddSubView];
    }
    return self;
}

- (void)viewAddSubView {
    NSInteger leftandRightSpec = 10;
    NSArray *arr = @[@"日",@"一",@"二",@"三",@"四",@"五",@"六"];
    NSInteger labelWidth = ([UIScreen mainScreen].bounds.size.width - 2 * leftandRightSpec) / arr.count;
    NSLog(@"== %ld",(long)labelWidth);
    for (int i = 0; i<arr.count; i++) {
        UILabel *label = [[UILabel alloc] init];
        label.textColor = [UIColor whiteColor];
        label.text = arr[i];
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont systemFontOfSize:14];
        label.frame = CGRectMake(leftandRightSpec + i*labelWidth, 0, labelWidth, 30);
        [self addSubview:label];
    }
}

@end
